package com.spic.job.api.factory;

import com.spic.common.core.domain.R;
import com.spic.job.api.RemoteActivitiService;
import com.spic.job.api.domain.HiddenGovernance;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.type.Alias;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Description 文件服务调用
 * @Author AnQi
 * @Date 2021/11/26
 */
@Slf4j
@Component
@Alias("RemoteActivitiToSyStemFallbackFactory")
public class RemoteActivitiToSyStemFallbackFactory implements FallbackFactory<RemoteActivitiService> {
    @Override
    public RemoteActivitiService create(Throwable cause) {
        return new RemoteActivitiService() {
            @Override
            public R<HiddenGovernance> getInfo(Integer id) {
                return R.fail("调用隐患服务失败！");
            }
        };
    }
}
